package sctu.edu.java.year2016.team01.xuhanmei.day20160524.practice4;

/**
 * Created by Administrator on 2016/5/24.
 */
public class JudgeNumber {
    public static void main(String[] args) {
        String num1="11024588795";
        String num2="15044268138";
        System.out.println(check(num1));
        System.out.println(check(num2));
    }
    public static String check(String handset){
        String regex="1[3,5,8]\\d(9)$";
        if(handset.matches(regex)){
            return handset+"\n是合法的手机号";
        }
        else{
            return handset+"\n不是合法的手机号";
        }
    }
}
